package com.youdianstar.app.entity


data class OpenTime(
    /*星期单位: 1-6, 周日 0*/
    var value: Int,
    /*是否全天*/
    var allDay: Boolean,
    /*是否开启*/
    var check: Boolean,

    var rangeTime1: List<String>?,
    var rangeTime2: List<String>?,
    var rangeTime3: List<String>?,
    var rangeTime4: List<String>?
){
    fun copyOpenItem(): OpenItem {
        val list1 = mutableListOf<String>()
        rangeTime1?.let { list1.addAll(it) }
        val list2 = mutableListOf<String>()
        rangeTime2?.let { list2.addAll(it) }
        val list3 = mutableListOf<String>()
        rangeTime3?.let { list3.addAll(it) }
        val list4 = mutableListOf<String>()
        rangeTime4?.let { list4.addAll(it) }

        return OpenItem(value,allDay,check, rangeTime1 = list1,rangeTime2 = list2,rangeTime3 = list3,rangeTime4 = list4)
    }
}